﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Reflection;
using System.Text;

namespace Cloak.Mvp.Autofac.ViewParameters
{
	/// <summary>
	/// Describes a check that a constructor parameter represents a presenter's view
	/// </summary>
	[ContractClass(typeof(IViewParameterSpecificationContract))]
	public interface IViewParameterSpecification
	{
		/// <summary>
		/// Determines if the specified parameter is a constructor parameter representing a view
		/// </summary>
		/// <param name="parameter">The parameter to check for representing a view</param>
		/// <returns>Whether the specified parameter represents a view in a constructor</returns>
		bool IsView(ParameterInfo parameter);
	}

	[ContractClassFor(typeof(IViewParameterSpecification))]
	internal abstract class IViewParameterSpecificationContract : IViewParameterSpecification
	{
		bool IViewParameterSpecification.IsView(ParameterInfo parameter)
		{
			Contract.Requires(parameter != null);

			return false;
		}
	}
}